<template>
  <div>
    <el-breadcrumb separator=">" style="font-size: 20px">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>一区车位剩余:{{this.remainder}}</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>

    <el-table
        :data="tableData"
        style="width: 100%">
      <el-table-column prop="id" label="编号" header-align="center" align="center" width="180"></el-table-column>
      <el-table-column prop="location" label="车位区域" header-align="center" align="center" width="180"></el-table-column>
      <el-table-column prop="locationNumber" header-align="center" align="center" label="车位编号"></el-table-column>
    </el-table>


  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
      remainder:''
    };
  },
  methods: {

    //请求车位列表
    loadParkingSpaceList() {
      let url = 'http://localhost:8080/ParkingSpace/ParkingSpaceListOne'
      this.axios
          .create({'headers': {'Authorization': localStorage.getItem('jwt')}})
          .get(url).then((response) => {
        let responseBody = response.data;
        console.log(this.editForm)
        if (responseBody.code == 200) {
          this.tableData = responseBody.data;
        }
      });
      let RemainderUrl = 'http://localhost:8080/ParkingSpace/getRemainderOne'
      this.axios
          .create({'headers': {'Authorization': localStorage.getItem('jwt')}})
          .get(RemainderUrl).then((response)=>{
        console.log(response.data)
        let responseBody= response.data;
        this.remainder = responseBody.data
      })
    }
  }
  ,
  created() {
    this.loadParkingSpaceList()
  }
}
</script>
